import { getAction, deleteAction, putAction, postAction, downFilePost, downFile, uploadAction } from '@/api/manage'

/**
 * 组织架构
 */
/*
网格员管理
 */
//获取网格树
const getBMlist = () => getAction(`/xl-org/mesh/tree`)
//创建网格
const addWG = params => postAction(`/xl-org/mesh/add`, params)
//删除网格
const deleteWG = params => postAction(`/xl-org/mesh/delete`, params)
//查找网格
const searchWG = params => postAction(`/xl-org/mesh/search`, params)
//编辑网格
const updateWG = params => postAction(`/xl-org/mesh/update`, params)

// 导入模板
export const userImportUrl = `/xl-org/user/import`
//网格员列表
const listWGY = params => postAction(`/xl-org/user/list`, params)
//新增网格员
const addWGY = params => postAction(`/xl-org/user/add`, params)
//修改密码
const updataPwd = params => postAction(`/xl-org/user/change/pwd`, params)
//更新网格员账号状态
const account = params => postAction(`/xl-org/user/change/account/status`, params)
//TODO 导出网格员
const exports = params => downFilePost(`/xl-org/user/export`, params)
//导入网格员
const imports = params => postAction(`/xl-org/user/import`, params)
//更新网格员信息
const updateWGY = params => postAction(`/xl-org/user/update`, params)
//查看网格员信息
const userWGY = params => postAction(`/xl-org/user/${params}`)
//获取网格员树
const userTree = params => getAction(`/xl-org/track/user-tree`, params)
//获取网格员轨迹
const userMap = params => postAction(`/xl-org/track/user-map`, params)
export {
  getBMlist,
  addWG,
  deleteWG,
  searchWG,
  updateWG,
  listWGY,
  addWGY,
  updataPwd,
  account,
  exports,
  imports,
  updateWGY,
  userWGY,
  userTree,
  userMap
}
